<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			function sum(){
				var total = 0;
				for(var i=0;i<arguments.length;i++){
					total += arguments[i];
				}
				return total;
			}
			var total = sum(2,4,2,1);
			alert(total);
		</script>
	</body>
</html>
